#include <DrawingRoot.hpp>

Drawing::Root::~Root()
{}

Drawing::Root::Root()
{}

Drawing::Root::Root(std::string filename) : Modeling::Root(filename)
{}

void Drawing::Root::animate(unsigned int frame)
{
	for (unsigned int i=0 ; i<this->getChildrenQty() ; i++)
		this->getChild(i)->animate(frame);
}

Drawing::Mesh* Drawing::Root::addMesh(std::string parent, std::string name)
{
	Drawing::Mesh* mesh = new Drawing::Mesh(name);
	this->addNode(parent, mesh);
	return mesh;
}

Drawing::Camera* Drawing::Root::addCamera(std::string parent, std::string name)
{
	Drawing::Camera* camera = new Drawing::Camera(name);
	this->addNode(parent, camera);
	return camera;
}

Drawing::Light* Drawing::Root::addLight(std::string parent, std::string name)
{
	Drawing::Light* light = new Drawing::Light(name);
	this->addNode(parent, light);
	return light;
}

Drawing::Material* Drawing::Root::getMaterial(std::string name)
{
	return (Drawing::Material*)this->material[name];
}

Drawing::Material* Drawing::Root::addMaterial(std::string name)
{
	Drawing::Material* material = new Drawing::Material(name);
	this->material[name] = material;
	return material;
}
